package sys.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sys.dao.StudentDao;
import sys.dao.TeacherDao;
import sys.entity.Dto;
import sys.entity.Student;
import sys.entity.Teacher;
import sys.service.StudentService;
import sys.service.TeaService;

import java.util.List;
import java.util.Map;

@Service
public class TeaServiceImpl implements TeaService {

   @Autowired
    private TeacherDao teacherDao;

    @Override
    public PageInfo findPage(Integer pageIndex, Map serachMap) {
        PageHelper.startPage(pageIndex,2);
        List<Teacher> list=teacherDao.findPages(serachMap);
        return new PageInfo(list);
    }

    @Override
    public void add(Teacher teacher) {
        teacherDao.add(teacher);
    }

    @Override
    public PageInfo findPageTea(Integer pageIndex, Map serachMap) {
        PageHelper.startPage(pageIndex,2);
        List<Dto> list=teacherDao.findPageTea(serachMap);
        return new PageInfo(list);
    }

}



